package com.iot.config.handler;

import cn.dev33.satoken.exception.NotLoginException;
import com.iot.commons.ResponseResult;
import com.iot.utils.ResponseResultUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: Ambation
 * @Description:
 * @Date Created in 2023-02-04-21:53
 * @Modified By:
 */
@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {
    @ExceptionHandler(NotLoginException.class)
    public ResponseResult businessException(NotLoginException e) {

        return ResponseResultUtil.failure("请重新登录",11014);
    }
}